package com.simple.mipclient.server;

import android.content.Intent;
import android.os.Bundle;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.simple.mipc.messager.ExecutorManager;
import com.simple.mipclient.R;
import com.simple.mipclient.server.func.TestFunction;
import com.simple.mipclient.server.service.MRemoteService;

public class ServiceMainActivity extends AppCompatActivity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_main);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });
        // 注册对外开放的功能
        ExecutorManager.getInstance().registerFunc(new TestFunction(this));
        // 启动对外暴露的Service
        startService(new Intent(this, MRemoteService.class));
    }
}